﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupFontDlg</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	border-width: 0;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupFontDlg<font size="4"> (since 3.0)</font></h2>
<p>Creates the Font Dialog element. It is a predefined dialog for 
  selecting a font. The dialog can be shown with the
  <strong>IupPopup</strong> function only.</p>
<h3><a name="Creation">Creation</a></h3>
<pre>Ihandle* IupFontDlg(void); [in C]
iup.fontdlg{} -&gt; (<strong>elem</strong>: ihandle) [in Lua]
fontdlg() [in LED]</pre>
<p><u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>
<p><b>PREVIEWTEXT</b> [GTK and Motif only]: the text shown in the preview area. If not 
defined the system will provide a default text.</p>
<p><b>COLOR</b> [Windows Only]: The initial color value and the returned 
selected value if the user pressed the Ok button. In Windows the Choose Font 
dialog allows the user to select a color from a pre-defined list of colors.</p>
<p><a href="../attrib/iup_parentdialog.html">PARENTDIALOG</a>
  (creation only): Name of a dialog to be used as parent. This dialog will 
  be always in front of the parent dialog. </p>
<p><b>STATUS</b> (read-only): defined to &quot;1&quot; if the user pressed the Ok button, NULL if 
pressed the Cancel button.</p>
<p><a href="../attrib/iup_title.html">TITLE</a>:
  Dialog title.</p>
<p><strong>VALUE</strong>: The initial font value and the returned selected 
value if the user pressed the Ok button. Has the same format of the
<a href="../attrib/iup_font.html">FONT</a> attribute.</p>
<h3><a name="Callbacks">Callbacks</a></h3>
<p><a href="../call/iup_help_cb.html">HELP_CB</a>: Action generated when the 
Help button is pressed.</p>
<h3><a name="Notes">Notes</a></h3>
<p>The <b>IupFontDlg</b> is a native pre-defined dialog not altered by <b>IupSetLanguage</b>.</p>
<p>To show the dialog, use function <b>IupPopup</b>. In Lua, use the <b>popup</b> function.</p>
<p>The dialog is mapped only inside <b>IupPopup</b>, <b>IupMap</b> does nothing.</p>
<p>In Windows, the dialog will be modal relative only to its parent or to the 
active dialog.</p>
<h3><a name="Examples">Examples</a></h3>
<pre>Ihandle* dlg = IupFontDlg();

IupSetAttribute(dlg, "COLOR", "128 0 255");
IupSetAttribute(dlg, "VALUE", "Times New Roman, Bold 20");
IupSetAttribute(dlg, "TITLE", "IupFontDlg Test");
IupSetCallback(dlg, "HELP_CB", (Icallback)help_cb);

IupPopup(dlg, IUP_CURRENT, IUP_CURRENT);

if (IupGetInt(dlg, "STATUS"))
{
  printf("OK\n");
  printf("  VALUE(%s)\n", IupGetAttribute(dlg, "VALUE"));
  printf("  COLOR(%s)\n", IupGetAttribute(dlg, "COLOR"));
}
else
  printf("CANCEL\n");

IupDestroy(dlg); </pre>
<div align="center">
  <center>
  <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1">
    <tr>
      <th>Windows XP</th>
    </tr>
    <tr>
      <td  align="center" class="style1"><img border="0" src="images/fontdlg_win.png"></td>
    </tr>
    <tr>
      <th>GTK/GNOME</th>
    </tr>
    <tr>
      <td  align="center" class="style1"><img border="0" src="images/fontdlg_gtk.png"></td>
    </tr>
    <tr>
      <th>Motif/MWM</th>
    </tr>
    <tr>
      <td  align="center" class="style1"><img border="0" src="images/fontdlg_mot.png"></td>
    </tr>
  </table>
  </center>
</div>
<h3><a name="SeeAlso">See Also</a></h3>
<p><a href="iupmessagedlg.html">IupMessageDlg</a>, 
<a href="iupgetfiledlg.html">IupFileDlg</a>, 
<a href="../func/iuppopup.html">IupPopup</a></p>

</body>

</html>